package com.vo;

import java.io.Serializable;
import java.util.Objects;

/**
 *
 * @author Matheus
 */
public class User implements Serializable
{
    private String name, email, password;
    /**
     * 
     * @param name Nome do usuario
     * @param email Email do usuario
     * @param password  Senha do usuario
     */
    public User(String name, String email, String password) 
    {
        this.name = name;
        this.email = email;
        this.password = password;
    }

    @Override
    public int hashCode() 
    {
        int hash = 5;
        hash = 37 * hash + Objects.hashCode(this.email);
        return hash;
    }

    @Override
    public boolean equals(Object obj) 
    {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) 
        {
            return false;
        }
        final User other = (User) obj;
        if (!Objects.equals(this.email, other.email)) 
        {
            return false;
        }
        return true;
    }
    /**
     * 
     * @param email Email do usuario
     * @param senha Senha do usuario
     */
    public User(String email, String senha) 
    {
        this.email = email;
        this.password = senha;
    }
    /**
     * Altera o email do usuario.
     * @param name 
     */
    public void setName(String name) 
    {
        this.name = name;
    }
    /**
     * Altera o email do usuario.
     * @param email 
     */
    public void setEmail(String email) 
    {
        this.email = email;
    }
    /**
     * Altera a senha do usuario.
     * @param password 
     */
    public void setPassword(String password) 
    {
        this.password = password;
    }
    
    /**
     * @return Email do usuario.
     */
    public String getEmail() 
    {
        return email;
    }

    /**
     * 
     * @return O nome do usuario.
     */
    public String getName() 
    {
        return name;
    }

    @Override
    public String toString() {
        return "User{" + "name: " + name +'}';
    }
    
    /**
     * 
     * @return A senha do usuario.
     */
    public String getPassword() 
    {
        return this.password;
    }
}
